<?php

class SON_Forms_RecuperarSenha extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');

        $email = new Zend_Form_Element_Text('email');
        $email->setRequired(true)
        	  ->addFilter('StripTags')
        	  ->addFilter('StringTrim')
        	  ->addValidator('NotEmpty', true, array('messages' => 'Informe um e-mail'))
        	  ->addValidator('EmailAddress', true, array('messages' => 'E-mail inválido'))
        	  ->addValidator('Db_RecordExists', false, array('table' => 'usuario', 'field' => 'email', 'messages' => 'E-mail não encontrado'))
        	  ->setAttrib('class', 'form-control')
        	  ->setAttrib('placeholder', 'E-mail')
        	->setAttrib('required', 'required');
        $this->addElement($email);
        
        $email->removeDecorator('HtmlTag')->removeDecorator('Label')->removeDecorator('Errors');
    }

}